﻿document.write("<script type='text/javascript' src='../Assets/Editors/kindeditor-4.0-beta/kindeditor-min.js'></script>");
document.write("<script type='text/javascript' src='../Assets/Editors/kindeditor-4.0-beta/lang/zh_CN.js'></script>");
document.write("<script type='text/javascript' src='resources/scripts/jquery.tagto.js'></script>");
KindEditor.ready(function (K) {
    var editor1 = K.create('#txtContent', {
        uploadJson: '/Assets/Editors/kindeditor-4.0-beta/plugins/filemanager/upload_json.ashx',
        fileManagerJson: '/Assets/Editors/kindeditor-4.0-beta/plugins/filemanager/file_manager_json.ashx',
        allowFileManager: true,
        afterCreate: function () {
            var self = this;
            K.ctrl(document, 13, function () {
                self.sync();
                K('form[name=addpostForm]')[0].submit();
            });
            K.ctrl(self.edit.doc, 13, function () {
                self.sync();
                K('form[name=addpostForm]')[0].submit();
            });
        }
    });

});

KindEditor.ready(function (K) {
    K.create('#txtSummary', {
        resizeType: 1,
        height: '200px',
        allowPreviewEmoticons: false,
        allowImageUpload: false,
        items: [
			'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
			'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
			'insertunorderedlist', '|', 'emoticons', 'link']
    });
});

(function ($) {
    $(document).ready(function () {
        $("#taglist").tagTo("#<%=txtTag.ClientID %>", ",", "selected");
    });
})(jQuery);